import request from '@/utils/request'

// 查询订单列表
export function listOrder(query) {
  return request({
    url: '/system/order/page',
    method: 'get',
    params: query
  })
}

//查询部门列表
export function listDept(query) {
  return request({
    url: '/system/dept/nameAndIdList',
    method: 'get',
    params: query
  })
}

// 查询订单详细
export function getOrder(orderid) {
  return request({
    url: '/system/order/' + orderid,
    method: 'get'
  })
}

// 新增订单
export function addOrder(data) {
  return request({
    url: '/system/order',
    method: 'post',
    data: data
  })
}

// 新增员工信息
export function addEmployee(data) {
  return request({
    url: '/system/employee/idAndNameList ',
    method: 'get',
    data: data
  })
}

// 修改订单
export function updateOrder(data) {
  return request({
    url: '/system/order',
    method: 'put',
    data: data
  })
}

// 删除订单
export function delOrder(id) {
  return request({ 
    url: '/system/order/' + id,
    method: 'delete'
  })
}

// 导出订单
export function exportOrder(query) {
  return request({
    url: '/system/order/export',
    method: 'get',
    params: query
  })
}

// 订单号生成 
export function getOrderCode(query) {
  return request({
    url: '/system/order/getOrderCode',
    method: 'get',
    params: query
  })
}